package com.fakeDYChat.common.common.constant;

import java.lang.reflect.Method;

/**
 * 存入Redis的键名生成
 *
 * @author Tang
 * @date 2023/12/12 14:29
 **/
public class RedisKey {
    private static final String BASE_KEY = "fake:dy:chat_";
    //用户token的key
    public static final String USER_TOKEN_STRING = "fake:dy:userToken_uid_%d";

    public static String getKey(String key, Object... o) {
        return BASE_KEY + String.format(key, o);
    }

    public static String getMethodKey(Method method) {
        return BASE_KEY + method.getDeclaringClass() + "#" + method.getName();
    }
}
